import NileAsDeps from '/snippets/nileasdeps.mdx';

<NileAsDeps />

<Step>
Your application must expose API routes to handle authentication operations.

Create a folder called `api` under the `app` folder and a folder called `[...nile]` under it:

```bash
mkdir -p app/api/\[...nile\]
```

Create following files handle the calls to your server, as well as expose the `nile` instance to your application:

```typescript app/api/[...nile]/nile.ts
import { Nile } from '@niledatabase/server';
import { nextJs } from '@niledatabase/nextjs';

export const nile = Nile({ extensions: [nextJs] });
```

```typescript app/api/[...nile]/route.ts
import { nile } from './nile';
export const { POST, GET, DELETE, PUT } = nile.handlers;
```

</Step>
